app.service('apiService', ['$http', '$q', function ($http, $q) {
    var apiService = {};

    	
    apiService.get = function(url, parameters) {
        return $http.get(url, { params: parameters }, { headers:{ 'Content-Type': 'application/json'} });
    };

    apiService.post = function (url, parameter) {
        return $http.post(url, parameter, { headers:  { 'Content-Type': 'application/json'} });
    };

    apiService.delete = function (url, parameter) {
      return $http.delete(url, parameter, { headers: { 'Content-Type': 'application/json'}});
    };
    
    apiService.put = function (url, parameter) {
      return $http.put(url, parameter, { headers:  { 'Content-Type': 'application/json'} });
    };
    
    return apiService;
}]);


